package com.yc.staticproxy;

/**
 * @ClassName StaticProxy
 * @since: 2023/8/1 18:56
 * @auth: kirito
 * @description:
 **/
public class StaticProxy implements OrderBiz{
    //目标类引用 利用set** 或构造方法 注入
    private OrderBiz orderBiz;

    public StaticProxy(OrderBiz orderBiz) {
        this.orderBiz = orderBiz;
    }


    @Override
    public void addOrder(int pid, int num) {
        showHello();
        this.orderBiz.addOrder(pid, num);
        showBye();
    }

    @Override
    public void findOrder() {

    }

    //增强
    public void showHello() {
        System.out.println("hello");
    }

    public void showBye() {
        System.out.println("bye");
    }
}